💯 solving-algo | January 18, 2021
https://www.acmicpc.net/problem/1712
a, b, c = map(int, input().rstrip().split())
count = 1
if b >= c:
print(-1)
else:
print(int(a/(c-b))+1)
https://www.acmicpc.net/problem/2292
a = int(input().rstrip())
cnt = 1
increase_number = 1
plus = 6
if a == 1:
print(1)
else:
while True:
increase_number += plus
cnt += 1
if increase_number >= a:
print(cnt)
break
plus += 6
https://www.acmicpc.net/problem/1193
x = int(input().strip())
line = 1
while x > line:
x -= line
line += 1
if line % 2 == 0:
a = x
b = line-x+1
else:
b = x
a = line-x+1
print(f'{a}/{b}')
https://www.acmicpc.net/problem/2869
a, b, c = map(int, input().rstrip().split())
answer = 0
if (c - b) % (a - b) != 0:
answer = ((c - b) // (a - b)) + 1
else:
answer = ((c - b) // (a - b))
print(answer)
https://www.acmicpc.net/problem/10250
t = int(input().rstrip())
for _ in range(t):
h, w, n = map(int, input().rstrip().split())
a = n % h
b = n // h + 1
if a == 0:
a = h
b -= 1
print(a * 100 + b)
https://www.acmicpc.net/problem/2775
t = int(input().rstrip())
for _ in range(t):
k = int(input())
n = int(input())
people = [i for i in range(1, n+1)]
for _ in range(k):
for j in range(1, n):
people[j] += people[j-1]
print(people[-1])
https://www.acmicpc.net/problem/2839
kg = int(input())
ans = 0
while True:
if kg % 5 == 0:
ans += (kg//5)
print(ans)
break
kg -= 3
ans += 1
if kg < 0:
print(-1)
break
https://www.acmicpc.net/problem/10757
※ 임의 정밀도 참고
a, b = map(int, input().rstrip().split())
print(a+b)
https://www.acmicpc.net/problem/1011
t = int(input())
for _ in range(t):
x, y = map(int,input().split())
distance = y - x
count = 0 # 이동 횟수
move = 1 # count별 이동 가능한 거리
move_plus = 0 # 이동한 거리의 합
while move_plus < distance :
count += 1
move_plus += move # count 수에 해당하는 move를 더함
if count % 2 == 0 : # count가 2의 배수일 때,
move += 1
print(count)